# -*- coding: utf-8 -*-
#  @author  Bink
#  @date  2021/4/13 2:17 下午
#  @Email : 2641032316@qq.com

import tensorflow as tf


with tf.Session() as sess:
    a = tf.random_normal(shape=[5, 5], mean=7.5, stddev=2.5 / 3, seed=0)
    # b = tf.random.uniform(shape=[5, 2], minval=0., maxval=1., seed=0)
    b = tf.random.truncated_normal(shape=[5, 2], mean=0.5, stddev=0.25, seed=0)
    c = tf.random.normal(shape=[5, 5], mean=0.5, stddev=0.5 / 3, seed=0)
    # print('a:\n', sess.run(a))
    # print('b:\n', sess.run(b))
    # print('c:\n', sess.run(c))
    tmp = sess.run(tf.matmul(a, b))
    print('tf.matmul(a, b):\n', tmp)
    print('tf.multiply(a, c):\n', sess.run(tf.multiply(a, c)))
    print('tf.add(0.1, tmp)\n', sess.run(tf.add(0.1, tmp)))

    # a = tf.constant([1, 2, 3], dtype=tf.int8)
    # b = tf.constant([1, 2, 3], dtype=tf.int8)
    # print("tf.multiply(a, b)\n", sess.run(tf.multiply(a, b)))
    # print("a * b\n", sess.run(a * b))
    # a = tf.constant([[1, 2, 3]], dtype=tf.float32)
    # b = tf.constant([[1], [2], [3]], dtype=tf.float32)
    # print("tf.matmul(a, b)\n", sess.run(tf.matmul(a, b)))
